# -*- coding: utf-8 -*-
"""
随机生成身份证
"""
import random
from Config.idCard.identity import IdNumber
# from faker import Faker


def creart_id():
    # faker = Faker("zh_CN")
    # print("姓名", faker.name())
    random_sex = random.randint(0, 1)  # 随机生成男(1)或女(0)
    id_num = IdNumber.generate_id(random_sex)
    print("身份证：", id_num)
    # print("手机号:", faker.phone_number())
    # print("银行卡号:", faker.credit_card_number())
    print("地址编码:", IdNumber(id_num).area_id)  # 地址编码:410326
    print("地址:", IdNumber(id_num).get_area_name())  # 地址:河南省洛阳市汝阳县
    print("生日:", IdNumber(id_num).get_birthday())  # 生日:1995-7-10
    print("年龄:", IdNumber(id_num).get_age())  # 年龄:23(岁)
    print("性别(1男0女):", IdNumber(id_num).get_sex())  # 性别:1(男)
    print("校验码:", IdNumber(id_num).get_check_digit())  # 校验码:7
    print("检验身份证是否正确:", IdNumber.verify_id(id_num))  # 检验身份证是否正确:False




if __name__ == '__main__':
    creart_id()
